package com.hzd.entity;

import com.avaje.ebean.annotation.CreatedTimestamp;
import com.avaje.ebean.annotation.UpdatedTimestamp;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.sql.Timestamp;

/**
 * BaseEntity
 *
 * @author christ
 * @date 5/20/2015
 */
@MappedSuperclass
public abstract class BaseEntity implements ablaze.framework.entity.BaseEntity {

    @Column(columnDefinition = "varchar(32) COMMENT'创建人'")
    protected String creator;

    @Column(columnDefinition = "varchar(32) COMMENT'修改人'")
    protected String modifier;

    @CreatedTimestamp
    @Column(columnDefinition = "datetime not null COMMENT'创建时间'")
    protected Timestamp createtime;

    @UpdatedTimestamp
    @Column(columnDefinition = "datetime not null COMMENT'修改时间'")
    protected Timestamp modifytime;

    @Column(columnDefinition = "tinyint(1) not null default 0 COMMENT'删除标志位，1为删除'")
    protected Integer isDelete = 0;

    public String getCreator() {
        return creator;
    }

    public BaseEntity setCreator(String creator) {
        this.creator = creator;
        return this;
    }

    public String getModifier() {
        return modifier;
    }

    public BaseEntity setModifier(String modifier) {
        this.modifier = modifier;
        return this;
    }

    public Timestamp getCreatetime() {
        return createtime;
    }

    public BaseEntity setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
        return this;
    }

    public Timestamp getModifytime() {
        return modifytime;
    }

    public BaseEntity setModifytime(Timestamp modifytime) {
        this.modifytime = modifytime;
        return this;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public BaseEntity setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
        return this;
    }
}
